package io.lvdaxian.middleware.db.router.dynamic;

import io.lvdaxian.middleware.db.router.DBContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 这是 动态数据源
 *
 * @author lihh
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
  
  @Override
  protected Object determineCurrentLookupKey() {
    return "db" + DBContextHolder.getDBKey();
  }
}
